/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.designpatterns.creational.abstractfactory;

/**
 *
 * @author BassonCJ
 */
public class PersonFactory {
    public Person getPerson(String name){
        if(name.equalsIgnoreCase("student")){
            return new Student();
        }
        else if(name.equalsIgnoreCase("doctor")){
            return new Doctor();
        }
        else
           return new Lecturer();
    }
}
